<template>
  <div class="container">
    <div>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form ref="form" :model="form"  label-width="100px">
            <el-form-item label="选择日期：">
              <el-date-picker
                v-model="form.valueDay"
                type="month"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
            <el-form-item label="姓名：">
          <el-input style="width:220px;"
            v-model="form.AA"
            placeholder="请输入环卫人员姓名"
            class="handle-input mr10"
          ></el-input>
        </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="班组：">
              <el-select v-model="teamValue" placeholder>
                <el-option
                  v-for="item in teamList"
                  :key="item.CLIENT_NO"
                  :label="item.CLIENT_NAME"
                  :value="item.CLIENT_NO"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form" style="float:left">
            <el-button size="mini" type="primary" @click="getlistdata">查 询</el-button>
            <!-- <el-button size="mini" type="success" @click="exportExcel">导 出</el-button> -->
            <el-button size="mini" type="success" @click="handleEdit2">新 增</el-button>
          </el-form>
        </el-col>
      </el-row>
      <!-- <el-row :gutter="0" style="margin-top: 20px;margin-bottom: 20px;">
        <el-col :span="3" :offset="7">
          <span>正常率：{{attendanceStatistics.NormalRate}}</span>
        </el-col>
        <el-col :span="3">
          <span>迟到率：{{attendanceStatistics.TardinessRate}}</span>
        </el-col>
        <el-col :span="3">
          <span>早退率：{{attendanceStatistics.EarlyRate}}</span>
        </el-col>
      </el-row> -->
    </div>
    <el-table  v-loading="loading" :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" highlight-current-row>
      <!-- <el-table-column sortable prop="VID" label="编号" align="center"></el-table-column> -->
      <el-table-column prop="Name" label="姓名" align="center"></el-table-column>
      <el-table-column prop="Cleanrance" label="清运队" align="center"></el-table-column>
      <el-table-column prop="Team" label="班组" align="center"></el-table-column>
      <el-table-column prop="WorkArea" label="作业范围" align="center"></el-table-column>
      <el-table-column prop="ZC" label="日期" align="center"></el-table-column>
      <el-table-column prop="CD" label="考勤状态" align="center"></el-table-column>
 <!-- <el-table-column sortable prop="ZC" label="正常" align="center"></el-table-column>
      <el-table-column sortable prop="CD" label="迟到" align="center"></el-table-column>
      <el-table-column sortable prop="ZT" label="早退" align="center"></el-table-column>
      <el-table-column sortable prop="SBWDK" label="上班未打卡" align="center" width="120px"></el-table-column>
      <el-table-column sortable prop="XBWDK" label="下班未打卡" align="center" width="120px"></el-table-column>  -->
      <!-- <el-table-column sortable prop="KKQQ" label="考勤状态" align="center"></el-table-column> -->
      <el-table-column label="操作" width="100">
        <template slot-scope="scope">
          <el-button type="text" icon="el-icon-info" @click="handleEdit3(scope.$index, scope.row)">修正</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        background
        layout="total, sizes, prev, pager, next, jumper"
        :current-page="currentPage"
        :page-size="pageSize"
        :total="tableData.length"
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
      ></el-pagination>
    </div>
    <!-- 修改列表 -->
    <el-dialog
      title="新增考勤记录调整信息"
      :visible.sync="isShowDialogUpdate"
      width="50%"
    >
      <el-form ref="form" :model="form" label-width="100px" class="flex">
        <el-form-item label="姓名：" class="wid50">
          <el-input
          style="width:220px;"
            v-model="form.name"
            placeholder="请输入环卫人员姓名"
            class="handle-input mr10"
          ></el-input>
        </el-form-item>
        <el-form-item label="选择日期：">
              <el-date-picker
                v-model="form.kqDay"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
        <el-form-item label="考勤状态：" class="wid50">
          <el-select
            v-model="form.type"
            placeholder="请选择"
            @change="changerole"
          >
            <el-option
              v-for="(item, index) in selectKQType"
              :key="index"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <!-- <el-form label-width="100px" class="flex">
        <el-form-item label="功能页面：" class="wid50">
          <div style="margin: 15px 0"></div>
          <el-tree
            :data="data"
            show-checkbox
            node-key="functionID"
            ref="tree"
            accordion
            :default-expanded-keys="checkedCities"
            :default-checked-keys="checkedCities"
            :props="defaultProps"
          ></el-tree>
        </el-form-item>
      </el-form> -->
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowDialogUpdate = false">取 消</el-button>
        <el-button type="primary" @click="handleEdit4()">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 详情列表 -->
    <el-dialog :title="titleDialogDetail" :visible.sync="isShowDialogDetail" width="60%">
      <el-row :gutter="0" style="margin-top: 20px;margin-bottom: 20px;">
        <el-col :span="3" :offset="7">
          <span>正常率：{{attendanceDetailStatistics.NormalRate}}</span>
        </el-col>
        <el-col :span="3">
          <span>迟到率：{{attendanceDetailStatistics.TardinessRate}}</span>
        </el-col>
        <el-col :span="3">
          <span>早退率：{{attendanceDetailStatistics.EarlyRate}}</span>
        </el-col>
      </el-row>
      <el-form class="dialogform">
        
        <el-table :data="attendanceMonthDetail.attendanceList" style="width: 100%" fit max-height="450">
          <el-table-column prop="Name" label="姓名" align="center"></el-table-column>
            <el-table-column prop="Cleanrance" label="清运队" align="center"></el-table-column>
            <el-table-column prop="Team" label="班组" align="center"></el-table-column>
            <el-table-column prop="WorkArea" label="作业范围" align="center"></el-table-column>
            <el-table-column prop="WorkDate" label="日期" align="center"></el-table-column>
            <el-table-column sortable prop="SwQianRu" label="上午签入" align="center"></el-table-column>
            <el-table-column sortable prop="SwQianChu" label="上午签出" align="center"></el-table-column>
            <el-table-column sortable prop="XwQianRu" label="下午签入" align="center"></el-table-column>
            <el-table-column sortable prop="XwQianChu" label="下午签出" align="center"></el-table-column>
        </el-table>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
import '@/assets/css/common.css'
import { formatDate } from '@/common/js/date.js'
import export2Excel from '@/utils/exportExcel/index.js'
export default {
  data () {
    return {
      currentPage: 1, //初始页
      pageSize: 10,    //    每页的数据
      loading: false,
      form: {
        radioData: '日',
        valueDay: formatDate(new Date(new Date() - 3600 * 1000 * 24), 'yyyy-MM-dd'),
        valueMonth: '',
        name:'',
        type:'',
        kqDay:'',
      },
      teamList: [],
      teamValue: '',
      isShowDialogUpdate: false,
      isShowDialogDetail: false,
      titleDialogDetail:'',
      attendanceMonthDetail: {},
      attendanceDetailStatistics: {},
      attendanceStatistics: {},
      tableData: [],
selectKQType: [{
        value: '旷工',
        label: '旷工'
      },{
        value: '迟到',
        label: '迟到'
      }, {
        value: '早退',
        label: '早退'
      }, {
        value: '请假',
        label: '请假'
      }, {
        value: '加班',
        label: '加班'
      }],
    }
  },
  created () {
    this.getTeamList();
  },
  methods: {
    async getTeamList () {

      const { data } = await this.$Http.get('/DataListCompany/GetCleanerGroupListApi?ClientNo=' + localStorage.getItem('CLIENT_NO'))
      this.teamList = data
      this.teamValue = data[0].CLIENT_NO
      this.getlistdata()
    },
    async getlistdata () {
      this.currentPage = 1;
      // this.loading = true
      // var url = 'DataListCompany/GetAttendanceMonthApi?ClientNo=' + this.teamValue + '&workDate=' + this.form.valueDay
      // console.log('url=' + url)
      // const { data } = await this.$Http.get(url)
      // this.attendanceStatus = data.status
      this.tableData = [
    {
        "VID":"2",
        "Name":"王顺成",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路3、驯海南路",
        "ZC":"2023-02-21",
        "CD":"早退",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"3",
        "Name":"何淑才",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路6",
        "ZC":"2023-02-21",
        "CD":"迟到",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"4",
        "Name":"李俊珍",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"丰安路2",
        "ZC":"2023-02-20",
        "CD":"迟到",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"5",
        "Name":"刘绍勇",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"旌智道1",
        "ZC":"2023-02-18",
        "CD":"迟到",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"6",
        "Name":"张吉明",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"枫泽园、丽新里、石油",
        "ZC":"2023-02-18",
        "CD":"加班",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"7",
        "Name":"苏春喜",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路2",
        "ZC":"2023-02-18",
        "CD":"加班",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"8",
        "Name":"（维修）王培英",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路4",
        "ZC":"2023-02-17",
        "CD":"迟到",
        "ZT":"0天,0次",
        "SBWDK":"28天,55次",
        "XBWDK":"28天,56次",
        "QQ":"27天"
    },
    {
        "VID":"9",
        "Name":"吴从纯",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路7",
        "ZC":"2023-02-17",
        "CD":"旷工",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"10",
        "Name":"吴振源",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"晨宏道1",
        "ZC":"2023-02-16",
        "CD":"早退",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"11",
        "Name":"邢维强",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路1",
        "ZC":"2023-02-15",
        "CD":"迟到",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"12",
        "Name":"徐广丽",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"晨宏道2",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"13",
        "Name":"杨立江",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"电大路",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"14",
        "Name":"袁香兰",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"津塘公路5",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"15",
        "Name":"张淑凡",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"东平路、龙廷路",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"17",
        "Name":"梁宝齐",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"霞宏道",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"596",
        "Name":"林文献",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"常熟北里、常熟南里、",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"597",
        "Name":"常杏",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"丰安路1",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"598",
        "Name":"（维修）李成芬",
        "Cleanrance":"丰年清扫队",
        "Team":"丰年班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"661",
        "Name":"魏守明",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"667",
        "Name":"蔡洪乐",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"694",
        "Name":"杜洪星",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"744",
        "Name":"魏以惠",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"747",
        "Name":"范有银",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"750",
        "Name":"闫桂通",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"762",
        "Name":"董文生",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"765",
        "Name":"（病假）于春立",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"782",
        "Name":"胡正顺",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"829",
        "Name":"么恩来",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"830",
        "Name":"魏正元",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"834",
        "Name":"黄士利",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"836",
        "Name":"胡正江",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"843",
        "Name":"侯孟余",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"845",
        "Name":"（维修）孙立金",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"847",
        "Name":"杨庆福",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"849",
        "Name":"张玉岭",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"850",
        "Name":"杨廷喜",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"853",
        "Name":"魏领金",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"南坨工业园",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"854",
        "Name":"信建忠",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"855",
        "Name":"胡玉柱",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"南坨工业园",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"919",
        "Name":"冯桂芹",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"926",
        "Name":"陈洲福",
        "Cleanrance":"华明清扫队",
        "Team":"高新区班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"664",
        "Name":"高立柱",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"669",
        "Name":"杨美连",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"708",
        "Name":"孙玉洪",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"709",
        "Name":"（维修）刘和山",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"735",
        "Name":"张芹",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"1天,1次",
        "ZT":"0天,0次",
        "SBWDK":"28天,55次",
        "XBWDK":"28天,55次",
        "QQ":"27天"
    },
    {
        "VID":"759",
        "Name":"魏汉有",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"764",
        "Name":"储信有",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"786",
        "Name":"杨恩奎",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"794",
        "Name":"杨廷国",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"1天,1次",
        "ZT":"0天,0次",
        "SBWDK":"28天,55次",
        "XBWDK":"28天,56次",
        "QQ":"27天"
    },
    {
        "VID":"795",
        "Name":"魏正英",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"797",
        "Name":"黄文海",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"816",
        "Name":"储景才",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"844",
        "Name":"侯孟才",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"864",
        "Name":"张杏兴",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"3天,3次",
        "ZT":"2天,2次",
        "SBWDK":"28天,53次",
        "XBWDK":"28天,54次",
        "QQ":"25天"
    },
    {
        "VID":"889",
        "Name":"张玉森",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内二班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"663",
        "Name":"魏成江",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"676",
        "Name":"魏荣孝",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"700",
        "Name":"于广禄",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"736",
        "Name":"魏定有",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"751",
        "Name":"魏乾有",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"760",
        "Name":"杨华国",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"777",
        "Name":"魏以庆",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"793",
        "Name":"刘金明",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"796",
        "Name":"（卡遗失）冯桂芹",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"0天,0次",
        "ZT":"0天,0次",
        "SBWDK":"28天,56次",
        "XBWDK":"28天,56次",
        "QQ":"28天"
    },
    {
        "VID":"837",
        "Name":"魏荣来",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"838",
        "Name":"魏荣顺",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"1天,1次",
        "ZT":"0天,0次",
        "SBWDK":"28天,55次",
        "XBWDK":"28天,56次",
        "QQ":"27天"
    },
    {
        "VID":"860",
        "Name":"魏宗义",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"862",
        "Name":"杜全章",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"0天,0次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    },
    {
        "VID":"865",
        "Name":"杨艳利",
        "Cleanrance":"华明清扫队",
        "Team":"华明园内三班组",
        "WorkArea":"",
        "ZC":"0天",
        "CD":"2天,2次",
        "ZT":"1天,1次",
        "SBWDK":"28天,54次",
        "XBWDK":"28天,55次",
        "QQ":"26天"
    }
]
   
      // this.attendanceStatistics = data.attendanceStatistics
      // this.loading = false
    },
    // 导出Excel
    exportExcel () {
      let excelName = '考勤记录信息列表(月)'
      const tHeader = ['编号', '姓名', '清运队', '班组', '作业范围', '正常', '迟到', '早退', '上班未打卡', '下班未打卡', '缺勤']
      const filterVal = ['VID', 'Name', 'Cleanrance', 'Team', 'WorkArea', 'ZC',"CD", 'ZT', 'SBWDK', 'XBWDK', 'QQ']
      export2Excel(tHeader, filterVal, this.tableData, excelName)
    },
    async handleEdit3 (index, row) {
      row.CD = '正常'
    },
    async handleEdit2 (index, row) {
      this.isShowDialogUpdate = true
    },
    handleEdit4 () {
      this.tableData.unshift({Name:this.form.name,Cleanrance:'华明清扫队',Team:'高新区班组',WorkArea:'南坨工业园',ZC:this.form.kqDay,CD:this.form.type})
      this.isShowDialogUpdate = false
    },
    //详情
    async handleEdit (index, row) {
      //   this.idx = index;
      //   this.form = row;
      //   this.editVisible = true;
      const params = {
        ClientNo: this.teamValue,
        workDate: this.form.valueDay,
        vid: row.VID
      }
      this.titleDialogDetail = row.Name + '考勤记录(月)-详情'
      const { data } = await this.$Http.get('/DataListCompany/GetAttendanceDetailDataApi', { params })
      this.attendanceDetailStatistics = data.attendanceStatistics
      // this.attendanceMonthDetail.TardinessRate = data.attendanceStatistics.TardinessRate
      // this.attendanceMonthDetail.EarlyRate = data.attendanceStatistics.EarlyRate
      this.attendanceMonthDetail.attendanceList = data.detailList
      this.isShowDialogDetail = true
    },
    // 分页导航
    handlePageChange (currentPage) {
      this.currentPage = currentPage;
      // console.log(this.currentPage)
      // this.$set(this.query, 'pageIndex', val);
      // this.getData();
    },
    handleSizeChange (size) {
      this.pageSize = size;
      console.log(this.pageSize)
    }
  }
}
</script>
<style>
.content {
  overflow-y: scroll;
}
.el-col-6 {
  min-width: 400px;
  min-height: 50px;
}
.el-table th {
  height: 40px;
}
</style>